importPackage(net.sf.odinms.client);
importPackage(net.sf.odinms.server.maps);

var status = -1;

function start() {
    action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
        	cm.dispose();
	} else {
		if (mode == 0 && status == 0) {
			cm.sendOk("See you next time");
			cm.dispose();
			return;
		}
        	if (mode == 1) {
            		status++;
		} else {
            		status--;
        	}
        	if (status == 0) {
			if(cm.getChar().getMapId() == 980000000) {
				cm.sendSimple("What do you want to do?\r\n#L1#I want to go to carnival field #e#b1#n#k#l\r\n#L2#I want to go to carnival field #e#b2#n#k#l\r\n#L3#I want to go to carnival field #e#b3#n#k#l\r\n#L4#I want to go to carnival field #e#b4#n#k#l\r\n#L5#I want to go to carnival field #e#b5#n#k#l\r\n#L6#I want to go to carnival field #e#b6#n#k#l");
			} else {
				cm.sendSimple("What do you want to do?\r\n#L1#Go to the carnival PQ#l\r\n#L2#Trade #i4001129# for items#k#l");
			}
		} else if (status == 1) {
			if (cm.getChar().getMapId() == 980000000) {
				if (selection == 1) {
					cm.warp(980000100);
					cm.dispose();
				} else if (selection == 2) {
					cm.warp(980000200);
					cm.dispose();
				} else if (selection == 3) {
					cm.warp(980000300);
					cm.dispose();
				} else if (selection == 4) {
					cm.warp(980000400);
					cm.dispose();
				} else if (selection == 5) {
					cm.warp(980000500);
					cm.dispose();
				} else if (selection == 6) {
					cm.warp(980000600);
					cm.dispose();
				}
			} else {
				if (selection == 1) {
					if (cm.getChar().getMapId() == 910000000) {
						cm.warp(980000000);
						cm.dispose();
					} else {
						cm.warpMC();
						cm.dispose();
					}
				} else {
					if (cm.itemQuantity(4001129) >= 1) {
					cm.sendOk("Talk to lucy, that bitch stole my job :O");
					cm.dispose();
				} else {
					cm.sendOk("You don't have an #i4001129#");
					cm.dispose();
				}
			}
		}
	}
}
}